<?php use think\Db; ?>
<div class="table-agile-info">
  <div class="panel panel-default">
    <div class="panel-heading">
       Express List
    </div>
    <form method="get">
    <div >

        <div class="row">

          <div class="col-md-2 form-group">
              <select class="input-sm form-control w-sm inline v-middle" name="status">
                <option value="0" {if condition="$status==0"}selected{/if}>全部(all)</option>
                <option value="1" {if condition="$status==1"}selected{/if}>已收到(received)</option>
                <option value="2" {if condition="$status==2"}selected{/if}>未收到(normal)</option>
              </select>
          </div>
          <div class="col-md-2 form-group">
            <input name="start" type="datetime" placeholder="date" class="datetimepicker form-control" readonly value="{$start}"> 
          </div>
          <div class="col-md-2 form-group">
            <input name="end" type="datetime" placeholder="date" class="datetimepicker form-control" readonly value="{$end}"> 
          </div>
          <div class="col-md-2 form-group">
           <input type="text" name="name" value="{$name}" class="input-sm form-control" placeholder="快件单号(express No.)">
          </div>
          <div class="col-md-2 form-group input-group-btn">
            <button class="btn btn-sm btn-default" type="submit">Search</button>
          </div>
        </div>

    </div>
  </form>
  <style>
  .ff{display: none;}
  </style>
    <div class="table-responsive">
      <table class="table table-striped b-t b-light">
        <thead>
          <tr>
            <th>Express No.</th>
            <th>Express Type</th>
            <th>Send Part</th>
            <th>Consignee</th>
            <th>Create Time</th>
            <th>Status</th>
            <th style="width:150px;">Operation</th>
          </tr>
        </thead>
        <tbody>
          {volist name="list" id="data"}
          <?php
            $bname=$data['bname'];
            if($data['part']){
              $binfo=Db::name('category')->where("id",(int)$data['part'])->field('name')->find();

              $bname=$binfo['name'];
            }
            if($data['from_branch']){
              $binfo1=Db::name('category')->where("id",(int)$data['from_branch'])->field('name')->find();

              $sname=$binfo1['name'];
            }            
          ?>
          <tr>
            <td><a href="javascript:void(0);" onclick="wl({$data.id})">{$data.order_No}</a></td>
            <td><span class="text-ellipsis">{if condition="$data['e_type'] eq 1"}LBC{else:}AP CARGO{/if}</span></td>
            <td><span class="text-ellipsis">{$sname}</span></td>
            <td><span class="text-ellipsis">{$bname}</span></td>
            <td><span style="color:red;">{$time}</span>|<?php echo date('Y-m-d',$data['create_time']);?></td>
            <td><span class="text-ellipsis"><span style="color:red;">{$data.track.status_text}</span>&nbsp;&nbsp;{if condition="$data['status'] eq 0"}正常(Normal){else:}已收到(finished){/if}</span></td>
            <td>
              {if condition="$data['from_branch'] eq $_SESSION['admin_id']"}
             <a href="/index/goods/goods_add/id/{$data.id}" target="blank"><i class="fa fa-check text-success text-active">Edit</i></a>&nbsp;&nbsp;<a href="/index/goods/goods_de/id/{$data.id}" target="blank"><i class="fa fa-times text-danger text">Del</i></a>
             {else :}
             <a href="/index/goods/goods_show/id/{$data.id}"><i class="fa fa-check text-success text-active">View</i></a>
             {/if}
            </td>
          </tr>
          <tr class="tra{$data.id} ff">
            <td></td>
            <td colspan="4">
              {$data.track.track}
            </td>
            <td colspan="2">{$data['content']}</td>
          </tr>
          {/volist}
        </tbody>
      </table>
    </div>
    <footer class="panel-footer">
      <div class="row">
      
        <div class="col-sm-7 text-right text-center-xs">                
        {$page}
        </div>
      </div>
    </footer>
  </div>
</div>
<script type="text/javascript">
$(function(){
  $('.datetimepicker').datetimepicker({
        minView: "month", //选择日期后，不会再跳转去选择时分秒 
        language:  'zh-CN',
        format: 'yyyy-mm-dd',
        initialDate: new Date(),//初始化当前日期
        autoclose: true,//选中自动关闭
    });  
})
function wl(id){
  $(".tra"+id).toggle()
}
</script>
</script>